package com.tpo;

import com.tpo.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class formActivity extends Activity{

	private EditText altura = null;
	private EditText calle = null;
	private EditText localidad = null;
	private EditText provincia = null;
	//private EditText pais = null;
	
	//private TextView maxNumero = null;	
		
		
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.form);
        
        Button buscar = (Button)findViewById(R.id.btnBuscar);
        buscar.setOnClickListener(new OnClickListener(){
        	public void onClick(View v){
        		
        		altura = (EditText) findViewById(R.id.editTextAltura);
                calle = (EditText) findViewById(R.id.editTextCalle);
                localidad = (EditText) findViewById(R.id.editTextLoc);
                provincia = (EditText) findViewById(R.id.editTextProv);
                //pais = (EditText) findViewById(R.id.editTextPais);
                //minNumero = (TextView) findViewById(R.id.minNumero);                
        		
                /*falta un metodo para pasar esta info al activty del mapa y que la resuelva*/
                
                showAlert(formActivity.this, formActivity.this.getResources().getString(R.string.hello), localidad.toString()+provincia.toString());
                
        	}
        
        });
         

       
    }	
	
	
	public static void showAlert(Context context, String title, String msg){
			Builder builder=new AlertDialog.Builder(context);
			builder.setTitle(title);
			builder.setNeutralButton(context.getResources().getString(R.string.hello), new DialogInterface.OnClickListener() {
		           public void onClick(DialogInterface dialog, int id) {
		                dialog.cancel();
		           }
		    });
			builder.setMessage(msg);
			builder.show();
		}	
	
	
	
	
	
	
}
